package com.hp_dzzl.client.particle;

import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.ParticleRenderType;
import net.minecraft.client.particle.TextureSheetParticle;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class NuclearExplosionPngShow extends TextureSheetParticle {

    protected NuclearExplosionPngShow(ClientLevel level, double x, double y, double z,
                                      double xSpeed, double ySpeed, double zSpeed) {
        super(level, x, y, z, xSpeed, ySpeed, zSpeed);

        // 设置粒子生命周期（以刻为单位，20刻=1秒）
        this.lifetime = 400;
        // 设置粒子大小
        this.quadSize = 5.0f;
        this.rCol = 1.0f;
        this.gCol = 1.0f;
        this.bCol = 1.0f;
    }

    @Override
    public void tick() {
        super.tick();
        // 粒子向上漂浮
        this.setPos(this.x, this.y + 0.02, this.z);
    }

    @Override
    public ParticleRenderType getRenderType() {
        // 使用半透明渲染类型
        return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
    }
}